<template>
  <!-- 确认预约弹窗 -->
  <el-dialog
    :model-value="visible"
    @update:model-value="$emit('update:visible', $event)"
    width="85%"
    class="confirm-booking-dialog"
  >
    <div class="confirm-booking-content">
      <div class="confirm-icon">🎫</div>
      <div class="confirm-title">是否确定预约该场次？</div>
      
      <div class="booking-summary">
        <div class="summary-item">
          <div class="summary-label">预约日期</div>
          <div class="summary-value">{{ bookingSummary.date }}</div>
        </div>
        <div class="summary-item">
          <div class="summary-label">体验时间</div>
          <div class="summary-value">{{ bookingSummary.timeSlot }}</div>
        </div>
        <div class="summary-item">
          <div class="summary-label">观众信息</div>
          <div class="summary-value">
            {{ bookingSummary.visitorInfo }}
          </div>
        </div>
        <div class="summary-item">
          <div class="summary-label">联系电话</div>
          <div class="summary-value">{{ bookingSummary.phone }}</div>
        </div>
      </div>
      
      <div class="booking-warning">
        <div class="warning-icon">⚠️</div>
        <div class="warning-text">
          <div class="warning-title">重要提醒</div>
          <div class="warning-desc">同一用户仅能预约一次，预约成功后不可再更改！</div>
        </div>
      </div>
    </div>
    
    <template #footer>
      <div class="confirm-footer">
        <el-button @click="$emit('cancel')" size="large" class="cancel-btn">
          取消
        </el-button>
        <el-button type="primary" @click="$emit('confirm')" size="large" class="confirm-submit-btn">
          确定预约
        </el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script setup>
// Props
const props = defineProps({
  visible: {
    type: Boolean,
    default: false
  },
  bookingSummary: {
    type: Object,
    default: () => ({
      date: '',
      timeSlot: '',
      visitorInfo: '',
      phone: ''
    })
  }
})

// Emits
const emit = defineEmits(['update:visible', 'confirm', 'cancel'])
</script>

<style scoped>
/* 确认预约弹窗样式 */
:deep(.confirm-booking-dialog) {
  border-radius: 16px;
  overflow: hidden;
}

:deep(.confirm-booking-dialog .el-dialog__header) {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 20px 24px;
  margin: 0;
  text-align: center;
}

:deep(.confirm-booking-dialog .el-dialog__title) {
  color: white;
  font-weight: 600;
  font-size: 18px;
}

:deep(.confirm-booking-dialog .el-dialog__headerbtn .el-dialog__close) {
  color: white;
  font-size: 20px;
  font-weight: bold;
}

:deep(.confirm-booking-dialog .el-dialog__body) {
  padding: 24px;
  background: #ffffff;
}

:deep(.confirm-booking-dialog .el-dialog__footer) {
  padding: 0;
  background: #ffffff;
}

.confirm-booking-content {
  text-align: center;
}

.confirm-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.confirm-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 24px;
}

.booking-summary {
  background: white;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.1);
  position: relative;
  overflow: hidden;
}

.booking-summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-item:hover {
  background: rgba(102, 126, 234, 0.05);
  margin: 0 -10px;
  padding: 12px 10px;
  border-radius: 8px;
}

.summary-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  position: relative;
}

.summary-label::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: #667eea;
  border-radius: 50%;
}

.summary-value {
  font-size: 15px;
  color: #333;
  font-weight: bold;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.booking-warning {
  background: linear-gradient(135deg, #fff3e0 0%, #ffecb3 100%);
  border: 1px solid #ffc107;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
  position: relative;
  overflow: hidden;
}

.booking-warning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff9800, #ffc107);
}

.warning-icon {
  font-size: 24px;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.warning-text {
  flex: 1;
  text-align: left;
}

.warning-title {
  font-size: 16px;
  font-weight: bold;
  color: #e65100;
  margin-bottom: 8px;
  text-shadow: 0 1px 2px rgba(230, 81, 0, 0.2);
}

.warning-desc {
  font-size: 14px;
  color: #f57c00;
  line-height: 1.5;
  font-weight: 500;
}

.confirm-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 24px 24px;
  background: white;
}

.confirm-footer .el-button {
  min-width: 120px;
  height: 48px;
  border-radius: 24px;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.confirm-footer .el-button:not(.el-button--primary) {
  background: #f5f5f5;
  border: 2px solid #ddd;
  color: #666;
}

.confirm-footer .el-button:not(.el-button--primary):hover {
  background: #eeeeee;
  border-color: #ccc;
  color: #555;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.confirm-submit-btn {
  background: linear-gradient(135deg, #667eea, #764ba2) !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
  position: relative;
  overflow: hidden;
}

.confirm-submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.confirm-submit-btn:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5) !important;
}

.confirm-submit-btn:hover::before {
  left: 100%;
}

.confirm-submit-btn:active {
  transform: translateY(-1px) !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
  :deep(.confirm-booking-dialog .el-dialog__body) {
    padding: 20px;
  }
  
  .confirm-icon {
    font-size: 36px;
    margin-bottom: 16px;
  }
  
  .confirm-title {
    font-size: 18px;
    margin-bottom: 20px;
  }
  
  .booking-warning {
    padding: 14px;
    gap: 10px;
  }
  
  .warning-icon {
    font-size: 20px;
  }
  
  .warning-title {
    font-size: 14px;
    margin-bottom: 6px;
  }
  
  .warning-desc {
    font-size: 13px;
  }
  
  .confirm-footer {
    padding: 15px 20px;
    gap: 15px;
  }
  
  .confirm-footer .el-button {
    min-width: 100px;
    height: 44px;
    font-size: 15px;
  }
}
</style> 